package com.zhuang.observer;

/**
 * @Classname Client
 * @Description 观察者模式 测试类
 * @Date 2021/3/28 14:16
 * @Created by dell
 */

public class Client {
    public static void main(String[] args) {
        SubscriptionSubject subject = new SubscriptionSubject();

        //创建微信用户
        WexinUser user1 = new WexinUser("张三");
        WexinUser user2 = new WexinUser("李四");
        WexinUser user3 = new WexinUser("王五");

        //订阅公众号
        subject.attach(user1);
        subject.attach(user2);
        subject.attach(user3);

        //通过订阅用户
        subject.notify("您关注的公众号更新啦~~~");
    }
}
